#ifndef DependencyParser_H
#define DependencyParser_H
#include<string>
#include<vector>
#include"ParserOptions.h"
#include"OnlineTrainer.h"
#include"OnlineTrainer2OSibling.h"
#include"OnlineTrainer2OGrandChild.h"
#include"OnlineTrainer2O.h"
#include"OnlineTrainer3OGSibling.h"
#include"OnlineTrainer3OTSibling.h"
#include"OnlineTrainer3O.h"
#include"OnlineTrainer4OGTSibling.h"
#include"Parameters.h"
using namespace std;

class DependencyParser{
public:
	ParserOptions* options;
	DependencyParser(DependencyPipe* pipe, ParserOptions* options);
	~DependencyParser();
	void train(vector<int>* instanceLengths, string* train_forest);
	void develop(vector<int>* instanceLengths, string* train_forest, string* devfile, string* logfile, string* goldfile);
	void saveModel(string* file);
	void loadModel(string* file);
	void outputParses();
	
private:
	DependencyPipe* pipe;
	DependencyDecoder* decoder;
	Parameters* params;
	void trainingIter(vector<int>* instanceLengths, int maxLength, string* train_forest, int iter);
	void developedIter(Parameters *params_bk, string *devfile, int maxLength);
	void developingIter(vector<int>* instanceLengths, int maxLength, string* train_forest, int iter, Parameters *params_bk);
};
#endif
